/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generator.relationships;

import java.util.Objects;

/**
 *
 * @author abosancic
 */
public class DataBaseRelationshipsModel {
    
    private String primaryKey;
    private String primaryTable;
    private String foreignKey;
    private String foreignTable;

    public DataBaseRelationshipsModel(String primaryKey, String primaryTable, String foreignKey, String foreignTable) {
        this.primaryKey = primaryKey;
        this.primaryTable = primaryTable;
        this.foreignKey = foreignKey;
        this.foreignTable = foreignTable;
    }

    public String getForeignTable() {
        return foreignTable;
    }

    public void setForeignTable(String foreignTable) {
        this.foreignTable = foreignTable;
    }

    public String getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
    }

    public String getPrimaryTable() {
        return primaryTable;
    }

    public void setPrimaryTable(String primaryTable) {
        this.primaryTable = primaryTable;
    }

    public String getForeignKey() {
        return foreignKey;
    }

    public void setForeignKey(String foreignKey) {
        this.foreignKey = foreignKey;
    }

    @Override
    public String toString() {
        return "ReferenceModel{" + "primaryKey=" + primaryKey + ", primaryTable=" + primaryTable + ", foreignKey=" + foreignKey + ", foreignTable=" + foreignTable + '}';
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 17 * hash + Objects.hashCode(this.foreignKey);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DataBaseRelationshipsModel other = (DataBaseRelationshipsModel) obj;
        if (!Objects.equals(this.foreignKey, other.foreignKey) && !Objects.equals(this.foreignTable , other.foreignTable)) {
            return false;
        }
        return true;
    }
    
    
}
